<template>
  <div>
        <!-- 顶部的navBar -->
    <van-nav-bar title="E商城" style="background-color:#40a380;color: #fff;">
  <template #right>

    <van-badge :content="5">
        <van-icon name="chat-o" size="24" />
    </van-badge>

  </template>
</van-nav-bar>

<!-- 中间切换路由现实的区域 -->
<div class="warpperBox">

<router-view></router-view>

</div>




        <!-- 底部的  tabBar -->
    <van-tabbar v-model="active">
      <van-tabbar-item replace to="/home" icon="home-o">首页</van-tabbar-item>
      <van-tabbar-item replace to="/category" icon="apps-o" >分类</van-tabbar-item>
      <van-tabbar-item replace to="/cart" icon="cart-o" badge="" dot>购物车</van-tabbar-item>
      <van-tabbar-item replace to="/my" icon="manager-o" badge=" " >我的</van-tabbar-item>
    </van-tabbar>


  </div>
</template>

<script>
export default {
created(){
  // this.$router.push(this.$route.path)
},
  data(){
return{
  active:0,

}},
}
</script>

<style >
.van-tabbar-item--active{
  color: #40a380 !important;
}
.van-hairline--bottom>.van-nav-bar__content>.van-nav-bar__title{
  color: #fff !important;
  font-weight: 600;
  font-size: 20px;
}
.van-badge__wrapper>.van-icon-chat-o{
    color: #fff !important;
}
.warpperBox{
  margin-top: 0px;
  width: 100%;
  height: calc(100vh - 96px);
  /* background-color: pink; */
  overflow: scroll
}
</style>